package com.gzsxy.esjy;

import io.netty.handler.codec.http.multipart.DiskAttribute;
import io.netty.handler.codec.http.multipart.DiskFileUpload;

import java.io.File;
import java.util.regex.Pattern;

/**
 * 常量类
 * @author zhangxiaolong
 * @date 2022/7/6 9:36
 */
public class SvConstant {
	
	/**
	 * 分割字符串常量
	 */
	public static final Pattern SPLIT_PATTERN_1= Pattern.compile("\\s*[,]+\\s*");
	public static final Pattern SPLIT_PATTERN_2= Pattern.compile("\\s*[;]+\\s*");
	public static final Pattern SPLIT_PATTERN_3= Pattern.compile("\\s*[=]+\\s*");
	
	
	public final static String DEFAULT_BANNER = 
			  " _  _     ___    _____   _____  __   __ \n"+
			  "| \\| |   | __|  |_   _| |_   _| \\ \\ / /\n"+ 
			  "| .` |   | _|     | |     | |    \\ V / \n"+ 
			  "|_|\\_|   |___|    |_|     |_|     |_|  \n"+ 
			  "                  Started on port %s \n";
	
	public static long MAX_LENGTH = 10*1024*1024 ;
	
	public static boolean KEEP_LIVE = true ;
	
	public static boolean FILE_KEEP_LIVE = false ;
	
	public static String FUP_DIR = "Fup" ;
	
//	public static long 
	
	static {
		File file = new File(FUP_DIR);
		if(!file.exists()) {
			file.mkdirs();
		}
		//退出时是否删除临时文件
		DiskFileUpload.deleteOnExitTemporaryFile = true; 
		//文件存储路径
		DiskFileUpload.baseDirectory = FUP_DIR;
		//退出时是否删除临时文件
		DiskAttribute.deleteOnExitTemporaryFile = true;
		//文件存储路径
		DiskAttribute.baseDirectory = FUP_DIR; 
	}
}
